package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DbNegotiationMapper;
import com.ruoyi.system.domain.DbNegotiation;
import com.ruoyi.system.service.IDbNegotiationService;

/**
 * 聊天详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-22
 */
@Service
public class DbNegotiationServiceImpl implements IDbNegotiationService 
{
    @Autowired
    private DbNegotiationMapper dbNegotiationMapper;

    /**
     * 查询聊天详情
     * 
     * @param id 聊天详情主键
     * @return 聊天详情
     */
    @Override
    public DbNegotiation selectDbNegotiationById(Long id)
    {
        return dbNegotiationMapper.selectDbNegotiationById(id);
    }

    /**
     * 查询聊天详情列表
     * 
     * @param dbNegotiation 聊天详情
     * @return 聊天详情
     */
    @Override
    public List<DbNegotiation> selectDbNegotiationList(DbNegotiation dbNegotiation)
    {
        return dbNegotiationMapper.selectDbNegotiationList(dbNegotiation);
    }

    /**
     * 新增聊天详情
     * 
     * @param dbNegotiation 聊天详情
     * @return 结果
     */
    @Override
    public int insertDbNegotiation(DbNegotiation dbNegotiation)
    {
        dbNegotiation.setCreateTime(DateUtils.getNowDate());
        return dbNegotiationMapper.insertDbNegotiation(dbNegotiation);
    }

    /**
     * 修改聊天详情
     * 
     * @param dbNegotiation 聊天详情
     * @return 结果
     */
    @Override
    public int updateDbNegotiation(DbNegotiation dbNegotiation)
    {
        dbNegotiation.setUpdateTime(DateUtils.getNowDate());
        return dbNegotiationMapper.updateDbNegotiation(dbNegotiation);
    }

    /**
     * 批量删除聊天详情
     * 
     * @param ids 需要删除的聊天详情主键
     * @return 结果
     */
    @Override
    public int deleteDbNegotiationByIds(Long[] ids)
    {
        return dbNegotiationMapper.deleteDbNegotiationByIds(ids);
    }

    /**
     * 删除聊天详情信息
     * 
     * @param id 聊天详情主键
     * @return 结果
     */
    @Override
    public int deleteDbNegotiationById(Long id)
    {
        return dbNegotiationMapper.deleteDbNegotiationById(id);
    }
}
